<template>
    <div>   
        <detail-banner 
        :imgs="gallaryImgs" 
        :title="sightName"
        :banner-img="bannerImg"></detail-banner>
        <detail-header :title="sightName"></detail-header>
        <div class="content">
            <detail-list :list="categoryList"></detail-list>
        </div>
    </div>
</template>

<script>
import DetailBanner from './components/Banner'
import DetailHeader from './components/Header'
import DetailList from './components/List'
import { getDetailInfo } from '@/api/detail'
export default {
    name:'Detail',
    components: {
        DetailBanner,
        DetailHeader,
        DetailList
    },
    data () {
        return {
            categoryList: [],
            gallaryImgs:[],
            sightName:'',
            bannerImg:'',
        }
    },
    mounted () {
        this.getDetail()
    },
    methods:{
        getDetail(){
            var params = {
                id:this.$route.params.id
            }
            getDetailInfo(params).then(response=>{
                if(response.data.ret){
                    this.categoryList = response.data.data.categoryList
                    this.gallaryImgs = response.data.data.gallaryImgs
                    this.bannerImg = response.data.data.bannerImg
                    this.sightName = response.data.data.sightName
                }
            })
        }
    }
}
</script>

<style lang="stylus" scoped>
@import '~styles/varibles.styl';
    .content
        height: 50rem
</style>